.search {
  font-size: 1em;
  position: relative;
}

.search input[type="search"] {
  background-color: hsla(var(--button-background), calc(var(--theme-header-search-opacity) / 100));
}

.is-header-search-text-justify-left .search input[type="search"] {
  text-align: left;
}

.is-header-search-text-justify-center .search input[type="search"] {
  text-align: center;
}

.is-header-search-text-justify-right .search input[type="search"] {
  text-align: right;
}

input[type="search"]:hover {
  background-color: hsla(var(--form-input-background-hover), calc(var(--theme-header-search-opacity) / 100));
}

input[type="search"]:focus,
input[type="search"]:active {
  background-color: hsla(var(--form-input-background-focus-active), calc(var(--theme-header-search-opacity) / 100));
}

input[type="search"]:disabled {
  background-color: hsla(var(--form-input-background-disabled), calc(var(--theme-header-search-opacity) / 100));
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, -50%);
  transition: opacity var(--layout-transition-extra-fast);
}

.is-search .search-clear {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  opacity: 1;
  pointer-events: all;
}

.is-search .search-clear:after {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.is-search .search-input {
  padding-right: 4em;
}

.is-header-search-opacity-low .search {
  --form-placeholder: var(--theme-primary-text-010);
  --form-placeholder-focus-hover: var(--theme-primary-text-010);
  --form-placeholder-disabled: var(--theme-primary-text-010);
}

.is-header-search-opacity-low.is-theme-background-type-accent .search {
  --form-placeholder: var(--theme-accent-text);
  --form-placeholder-focus-hover: var(--theme-accent-text);
  --form-placeholder-disabled: var(--theme-accent-text);
}

.is-header-search-opacity-low.is-theme-background-type-color .search {
  --form-placeholder: var(--theme-background-color-text);
  --form-placeholder-focus-hover: var(--theme-background-color-text);
  --form-placeholder-disabled: var(--theme-background-color-text);
}
